<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>招生章程详情</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
    <style>
        .w440{width: 440px !important;}
        .layui-form-item{color:#303030}
        .layui-form-label{font-weight:600;margin-right:20px;}
    </style>
</head>
<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form" id="tool">
        <div class="layui-tab">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label">章程名称：</label>
                        <div class="layui-input-inline w440">
                            ${enrollmentRule.name}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">创建时间：</label>
                            <div class="layui-input-inline w440">
                                <#if enrollmentRule.createTime??>${enrollmentRule.createTime?string('yyyy-MM-dd')}</#if>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">招生单位：</label>
                            <div class="layui-input-inline w440">
                                ${enrollmentRule.unit}
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">招生简介：</label>
                        <div class="layui-input-inline w440">
                            ${enrollmentRule.introduction}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'form', 'baseutil','page','layedit','laydate'], function () {
        var $ = layui.jquery,
            form = layui.form,
            page = layui.page,
            layedit = layui.layedit,
            laydate = layui.laydate,
            baseutil = layui.baseutil;

        laydate.render({elem: '#createTime', type: 'date'});
        //初始化富文本
        var index = baseutil.layeditKnifezBuild("introduction", 300);

        form.verify({
            content: function () {
                layedit.sync(index);
                if (isBlank($('#introduction').val())) {
                    return '请输入内容';
                }
            }
        });

        //监听提交
        form.on('submit(submitBtn)', function (data) {
            data.field.id = '${enrollmentRule.id}';
            data.field.introduction = baseutil.layeditBuildContent(index);
            baseutil.post("/enrollment/enrollmentrule/addOrUpdate", data.field, function () {
                $("#save").click();
            });
            return false;
        });
    });
</script>
</body>
</html>